﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Agenda_Project.Models.Committee>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Details</h2>

<fieldset>
    <legend>Committee</legend>

    <table>

    <tr>
    <td>
        <%: Html.ActionLink("Edit", "Edit", new { id=Model.ID }) %> |
        <%: Html.ActionLink("Back to List", "Index") %>
    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>

    <tr>
    <td class="editor-label"><%: Html.DisplayNameFor(model => model.Code) %></td>
    <td>&nbsp;:&nbsp;</td>
    <td class="editor-field"><%: Html.DisplayFor(model => model.Code) %></td>
    </tr>

    <tr>
    <td class="editor-label"><%: Html.DisplayNameFor(model => model.Name) %></td>
    <td>&nbsp;:&nbsp;</td>
    <td class="editor-field"><%: Html.DisplayFor(model => model.Name) %></td>
    </tr>

    <tr>
    <td class="editor-label"><%: Html.DisplayNameFor(model => model.NameTH) %></td>
    <td>&nbsp;:&nbsp;</td>
    <td class="editor-field"><%: Html.DisplayFor(model => model.NameTH) %></td>
    </tr>

    <tr>
    <td class="editor-label"><%: Html.DisplayNameFor(model => model.Remark) %></td>
    <td>&nbsp;:&nbsp;</td>
    <td class="editor-field"><%: Html.DisplayFor(model => model.Remark) %></td>
    </tr>

    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    
    <tr>
    <td colspan = "3">
        <p>
            <%: Html.ActionLink("Add Member", "MemberCreate", new { id = Model.ID } )%>
        </p>

        <table>

        <% int i = 0; %>
        <% foreach (Agenda_Project.Models.CommitteeMember member in Model.CommitteeMembers) { %>
            <% if (i == 0) { %>
            <tr>
                <th>
                    <%: Html.DisplayNameFor(model => member.Code)%>
                </th>
                <th>
                    <%: Html.DisplayNameFor(model => member.Name)%>
                </th>
                <th>
                    <%: Html.DisplayNameFor(model => member.NameTH)%>
                </th>
                <th>
                    <%: Html.DisplayNameFor(model => member.CommitteeRole.Name)%>
                </th>
                <th>
                    <%: Html.DisplayNameFor(model => member.Period)%>
                </th>
                <th>
                    <%: Html.DisplayNameFor(model => member.Remark)%>
                </th>
                <th></th>
            </tr>
            <% } %>

            <tr>
                <td>
                    <%: Html.DisplayFor(modelItem => member.Code)%>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => member.Name)%>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => member.NameTH)%>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => member.CommitteeRole.Name)%>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => member.Period.BeginDate)%> - <%: Html.DisplayFor(modelItem => member.Period.EndDate)%>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => member.Remark)%>
                </td>
                <td>
                    <%: Html.ActionLink("Edit", "MemberEdit", new { id = member.ID })%> |
                    <%: Html.ActionLink("Details", "MemberDetails", new { id = member.ID })%> |
                    <%: Html.ActionLink("Delete", "MemberDelete", new { id = member.ID })%>
                </td>
            </tr>

            <% i++; %>
        <% } %>

        </table>
    </td>
    </tr>

    </table>
    
</fieldset>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
